.class public Lcom/glympse/platform/common/ServerPost$PostJob;
.super Lcom/glympse/platform/common/HttpJob;
.source "ServerPost.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/glympse/platform/common/ServerPost;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x4
    name = "PostJob"
.end annotation


# instance fields
.field public m_strEncoding:Ljava/lang/String;

.field final synthetic this$0:Lcom/glympse/platform/common/ServerPost;


# direct methods
.method protected constructor <init>(Lcom/glympse/platform/common/ServerPost;)V
    .locals 1
    .parameter

    .prologue
    .line 1286
    iput-object p1, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->this$0:Lcom/glympse/platform/common/ServerPost;

    invoke-direct {p0}, Lcom/glympse/platform/common/HttpJob;-><init>()V

    .line 1288
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->m_strEncoding:Ljava/lang/String;

    return-void
.end method


# virtual methods
.method public AddRequestHeaders(Lcom/glympse/platform/GHttpConnection;)V
    .locals 3
    .parameter "oHttpConn"

    .prologue
    .line 1325
    :try_start_0
    const-string v1, "User-Agent"

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v2

    invoke-virtual {v2}, Lcom/glympse/platform/Platform;->GetBrowserAgent()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p1, v1, v2}, Lcom/glympse/platform/GHttpConnection;->SetRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 1327
    iget-object v1, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->m_strEncoding:Ljava/lang/String;

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 1329
    const-string v1, "Content-Type"

    iget-object v2, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->m_strEncoding:Ljava/lang/String;

    invoke-virtual {p1, v1, v2}, Lcom/glympse/platform/GHttpConnection;->SetRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 1332
    :cond_0
    const-string v1, "Accept"

    const-string v2, "*/*"

    invoke-virtual {p1, v1, v2}, Lcom/glympse/platform/GHttpConnection;->SetRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 1333
    const-string v1, "Accept-Encoding"

    const-string v2, "identity"

    invoke-virtual {p1, v1, v2}, Lcom/glympse/platform/GHttpConnection;->SetRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 1334
    const-string v1, "Cache-Control"

    const-string v2, "no-cache"

    invoke-virtual {p1, v1, v2}, Lcom/glympse/platform/GHttpConnection;->SetRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 1335
    const-string v1, "Pragma"

    const-string v2, "no-cache"

    invoke-virtual {p1, v1, v2}, Lcom/glympse/platform/GHttpConnection;->SetRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 1337
    iget-object v1, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->this$0:Lcom/glympse/platform/common/ServerPost;

    iget-object v1, v1, Lcom/glympse/platform/common/ServerPost;->m_strSession:Ljava/lang/String;

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_1

    .line 1339
    const-string v1, "GLYMPSE_Session"

    iget-object v2, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->this$0:Lcom/glympse/platform/common/ServerPost;

    iget-object v2, v2, Lcom/glympse/platform/common/ServerPost;->m_strSession:Ljava/lang/String;

    invoke-virtual {p1, v1, v2}, Lcom/glympse/platform/GHttpConnection;->SetRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 1346
    :cond_1
    :goto_0
    return-void

    .line 1342
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 1344
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0
.end method

.method public OnComplete(Lcom/glympse/platform/common/JobQueue;)V
    .locals 1
    .parameter "oJobQueue"

    .prologue
    .line 1386
    invoke-virtual {p0}, Lcom/glympse/platform/common/ServerPost$PostJob;->DumpDownload()V

    .line 1388
    iget-object v0, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->this$0:Lcom/glympse/platform/common/ServerPost;

    invoke-virtual {v0}, Lcom/glympse/platform/common/ServerPost;->PostComplete()V

    .line 1389
    return-void
.end method

.method public PreProcess()V
    .locals 1

    .prologue
    .line 1294
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->m_fCompleteOnMainThread:Z

    .line 1297
    iget-object v0, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->this$0:Lcom/glympse/platform/common/ServerPost;

    iget-object v0, v0, Lcom/glympse/platform/common/ServerPost;->m_strUserId:Ljava/lang/String;

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->this$0:Lcom/glympse/platform/common/ServerPost;

    iget-object v0, v0, Lcom/glympse/platform/common/ServerPost;->m_strPassword:Ljava/lang/String;

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 1299
    :cond_0
    iget-object v0, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->this$0:Lcom/glympse/platform/common/ServerPost;

    invoke-virtual {v0}, Lcom/glympse/platform/common/ServerPost;->CreateAccount()V

    .line 1316
    :goto_0
    invoke-virtual {p0}, Lcom/glympse/platform/common/ServerPost$PostJob;->DumpUpload()V

    .line 1317
    return-void

    .line 1303
    :cond_1
    iget-object v0, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->this$0:Lcom/glympse/platform/common/ServerPost;

    iget-object v0, v0, Lcom/glympse/platform/common/ServerPost;->m_strSession:Ljava/lang/String;

    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_2

    .line 1305
    iget-object v0, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->this$0:Lcom/glympse/platform/common/ServerPost;

    invoke-virtual {v0}, Lcom/glympse/platform/common/ServerPost;->GetSessionToken()V

    goto :goto_0

    .line 1312
    :cond_2
    iget-object v0, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->this$0:Lcom/glympse/platform/common/ServerPost;

    invoke-virtual {v0}, Lcom/glympse/platform/common/ServerPost;->PhoneSession()V

    goto :goto_0
.end method

.method public ProcessResponseHeaders(Lcom/glympse/platform/GHttpConnection;)V
    .locals 6
    .parameter "oHttpConn"

    .prologue
    .line 1362
    :try_start_0
    invoke-virtual {p1}, Lcom/glympse/platform/GHttpConnection;->GetDate()J

    move-result-wide v1

    .line 1363
    .local v1, lServerTime:J
    const-wide/16 v3, 0x0

    cmp-long v3, v3, v1

    if-eqz v3, :cond_0

    .line 1366
    invoke-static {v1, v2}, Lcom/glympse/platform/common/CorrectedTime;->SetServerTime(J)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 1375
    .end local v1           #lServerTime:J
    :cond_0
    :goto_0
    iget-object v3, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->this$0:Lcom/glympse/platform/common/ServerPost;

    invoke-static {}, Lcom/glympse/platform/common/CorrectedTime;->GetTime()J

    move-result-wide v4

    iput-wide v4, v3, Lcom/glympse/platform/common/ServerPost;->m_lLastPostTime:J

    .line 1378
    iget-object v3, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->this$0:Lcom/glympse/platform/common/ServerPost;

    iget v4, p0, Lcom/glympse/platform/common/ServerPost$PostJob;->m_nResultCode:I

    iput v4, v3, Lcom/glympse/platform/common/ServerPost;->m_nLastPostResult:I

    .line 1379
    return-void

    .line 1369
    :catch_0
    move-exception v3

    move-object v0, v3

    .line 1371
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0
.end method
